﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Serialization;

namespace ForumBrowser.Models
{
    [XmlRoot(ElementName = "rss")]
    public class RssFeed
    {
        [XmlElement(ElementName = "channel")]
        public RssChannel Channel { get; set; }
    }

    public class RssChannel
    {
        [XmlElement(ElementName = "title")]
        public string Title { get; set; }

        [XmlElement(ElementName = "link")]
        public string Link { get; set; }

        [XmlElement(ElementName = "lastBuildDate")]
        public string PublicationDate { get; set; }

        [XmlElement(ElementName = "item")]
        public List<RssItem> Items { get; set; }
    }

    public class RssItem
    {
        [XmlElement(ElementName = "guid")]
        public string Guid { get; set; }

        [XmlElement(ElementName = "title")]
        public string Title { get; set; }

        [XmlElement(ElementName = "creator", Namespace = "http://purl.org/dc/elements/1.1/")]
        public string Author { get; set; }

        [XmlElement(ElementName = "link")]
        public string Link { get; set; }

        [XmlElement(ElementName = "pubDate")]
        public string PublicationDate { get; set; }

        [XmlElement(ElementName = "description")]
        public string Description { get; set; }
    }
}